package com.yiren.backstage.judge.handler;

import android.content.Context;
import android.os.Handler;
import android.os.Message;

import com.yiren.backstage.currency.constant.AutoJudgeConstant;
import com.yiren.backstage.currency.entity.GradeStandardEntity;
import com.yiren.backstage.currency.entity.LightCombinationEntity;
import com.yiren.backstage.currency.entity.ProjectEntity;
import com.yiren.backstage.currency.enums.TaskStateEnum;
import com.yiren.backstage.judge.api.IExamStateCallBack;
import com.yiren.backstage.judge.services.light.ILightJudgeService;
import com.yiren.backstage.judge.services.light.impl.LightJudgeServiceImpl;

/**
 * Time:2022/3/23 10:41
 * Author:xiaozan
 * Description:灯光评判 消息处理中心
 */
public class LightJudgeHandler extends Handler  {

    private ILightJudgeService iLightJudgeService;

    private TaskStateEnum taskStateEnum;

    public LightJudgeHandler(Context context, IExamStateCallBack iExamStateCallBack){
        iLightJudgeService = new LightJudgeServiceImpl(context,this,iExamStateCallBack);
    };

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        switch (msg.what){
            case AutoJudgeConstant.START_UP_LIGHT_TIPS://启动灯光操作前提示
                iLightJudgeService.startUpLightTips((ProjectEntity) msg.obj);
                break;
            case AutoJudgeConstant.START_UP_LIGHT_JUDGE://启动灯光评判
                iLightJudgeService.startUpLightJudge((ProjectEntity) msg.obj);
                break;
            case AutoJudgeConstant.ADD_PROJECT_GRADE://增加扣分
                iLightJudgeService.addGradeStandard((GradeStandardEntity)msg.obj);
                break;
            case AutoJudgeConstant.LIGHT_PROJECT_FINISHED://灯光项目完成
                iLightJudgeService.lightProjectFinish((ProjectEntity) msg.obj);
                break;
        }
    }

    public TaskStateEnum getTaskStateEnum() {
        return taskStateEnum;
    }

    public void setTaskStateEnum(TaskStateEnum taskStateEnum) {
        this.taskStateEnum = taskStateEnum;
    }
}
